package com.qiuling.iot.mapper;

import com.qiuling.iot.entity.SysRolePermission;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SysRolePermissionMapper {
    int deleteByPrimaryKey(String id);

    int insert(SysRolePermission record);

    int insertSelective(SysRolePermission record);

    SysRolePermission selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(SysRolePermission record);

    int updateByPrimaryKey(SysRolePermission record);

    /**----------------------------以下为自定义接口---------------------------------*/

    /**
     * @param list
     * @return int
     * @description 批量插入角色和菜单权限关联数据
     * </br>
     * @author zhangqiang
     * @date 19:09 2020/2/11
     */
    int batchInsertRolePermission(List<SysRolePermission> list);

    List<String> getRoleIdsByPermissionId(String permissionId);

    int removeByPermissionId(String permissionId);

    List<String> getPermissionIdsByRoleId(String roleId);

    List<String> getPermissionIdsByRoles(List<String> roleIds);

    int removeByRoleId(String roleId);
}